package example.rmi.stub;

import example.rmi.stub.handler.UserService;
import example.rmi.stub.entity.User;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

/**
 * @author Hao Yang
 */
public class ClientExample {

    public static void main(String args[]) throws RemoteException, NotBoundException, MalformedURLException {
        UserService userService = (UserService) Naming.lookup("//localhost:1099/userService");
        User user = userService.getUserById(1);
        System.out.println(user);
    }

}
